fix garmin_gpi debug code. (#853)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Mon, 21 Feb 2022 14:53:36 +0000 (07:53 -0700)
committerGitHub <noreply@github.com>
Mon, 21 Feb 2022 14:53:36 +0000 (07:53 -0700)
https://github.com/GPSBabel/gpsbabel/pull/833/files introduced a bug with unique_ptr.

garmin_gpi.cc

index 36d1aca91cb9418f7e5b8679a9c5daaaa24e2029..e40580e5fe776a2612e1a5d4a5b8f0fc16e71ccd 100644 (file)
@@ -571,7 +571,7 @@ GarminGPIFormat::read_tag(const char* caller, const int tag, Waypoint* wpt)
 #ifdef GPI_DBG
   {
     int x;
-    std::unique_ptr<unsigned char[]> b(new unsigned char(sz));
+    std::unique_ptr<unsigned char[]> b(new unsigned char[sz]);
     fprintf(stderr, "Tag: %x\n", tag);
     gbfread(b.get(), 1, sz, fin);
     fprintf(stderr, "\n");